package com.slz3.business.module.systemManagement.sysPermissions.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.systemManagement.sysPermissions.domain.SysPermissions;
import com.slz3.business.module.systemManagement.sysPermissions.domain.SysPermissionsCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class SysPermissionsResController {

    static Mono<ServerResponse> add(ServerRequest req, SysPermissions sysPermissions) {
        if (SysPermissionsResUnsafeValid.add(req, sysPermissions)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysPermissionsResAtomic.add_$SysPermissionsUpdateLock(req, sysPermissions);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, SysPermissionsCondition sysPermissionsCondition) {
        if (SysPermissionsResUnsafeValid.delete(req, sysPermissionsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysPermissionsResAtomic.delete_$SysPermissionsUpdateLock(req, sysPermissionsCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, SysPermissions sysPermissions) {
        if (SysPermissionsResUnsafeValid.modify(req, sysPermissions)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysPermissionsResAtomic.modify_$SysPermissionsUpdateLock(req, sysPermissions);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (SysPermissionsResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysPermissionsResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (SysPermissionsResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysPermissionsResAtomic.info_$SysPermissionsUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (SysPermissionsResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysPermissionsResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, SysPermissionsCondition sysPermissionsCondition) {
        //
        if (SysPermissionsResUnsafeValid.auditSubmit(req, sysPermissionsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysPermissionsResAtomic.auditSubmit_$SysPermissionsUpdateLock(req, sysPermissionsCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, SysPermissionsCondition sysPermissionsCondition) {
        if (SysPermissionsResUnsafeValid.audit(req, sysPermissionsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysPermissionsResAtomic.audit_$SysPermissionsUpdateLock(req, sysPermissionsCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, SysPermissionsCondition sysPermissionsCondition) {
        if (SysPermissionsResUnsafeValid.auditReject(req, sysPermissionsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysPermissionsResAtomic.auditReject_$SysPermissionsUpdateLock(req, sysPermissionsCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, SysPermissionsCondition sysPermissionsCondition) {
        if (SysPermissionsResUnsafeValid.usingEnable(req, sysPermissionsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysPermissionsResAtomic.usingEnable_$SysPermissionsUpdateLock(req, sysPermissionsCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, SysPermissionsCondition sysPermissionsCondition) {
        if (SysPermissionsResUnsafeValid.usingDisable(req, sysPermissionsCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysPermissionsResAtomic.usingDisable_$SysPermissionsUpdateLock(req, sysPermissionsCondition);
        }
    }

}
